package br.com.lucasddaniel.merchanmobile.dao;

/**
 * Classe com as possiveis excessoes de banco.
 * 
 * @author ldsm
 *
 */
public class ExcessaoBanco extends Exception {

	public static final int DATABASE_OPEN_FAIL    =  -1;
	public static final int DATABASE_NOT_OPEN     =  -2;
	public static final int INSUFFICIENT_MEMORY   =  -4;
	public static final int DATABASE_INSERT_FAIL  =  -8;
	public static final int DATABASE_UPDATE_FAIL  = -16;
	public static final int DATABASE_DELETE_FAIL  = -32;
	public static final int DATABASE_SELECT_FAIL  = -64;

	private static final long serialVersionUID = 1L;

	private int errorType;

	public ExcessaoBanco(String string, int errorType) {
		super(string);
		this.errorType = errorType;
	}
	
	public ExcessaoBanco(String string) {
		super(string);
	}

	@Override
	public String getMessage() {
		return super.getMessage()+errorType;
	}
}